package indexing;

import java.util.HashMap;
import java.util.Map;

import com.github.cleverage.elasticsearch.Index;
import com.github.cleverage.elasticsearch.Indexable;
import com.github.cleverage.elasticsearch.annotations.IndexMapping;
import com.github.cleverage.elasticsearch.annotations.IndexType;

@IndexType(name = "doctorname")
@IndexMapping(value = "{ \"doctorname\" : {  \"properties\" : {\"doctorname\" : {  \"type\" : \"string\",  \"search_analyzer\" : \"str_search_analyzer\",  \"index_analyzer\" : \"str_index_analyzer\"}," +
		"\"doctorname\" : {  \"type\" : \"string\",  \"search_analyzer\" : \"str_search_analyzer\",  \"index_analyzer\" : \"str_index_analyzer\"}  }}  }")
public class DoctorNameIndex extends Index{

	public String doctornames;
	
	 // Find method static for request
    public static Finder<KeywordIndex> find = new Finder<KeywordIndex>(KeywordIndex.class);
    
    @Override
    public Map toIndex() {
    	 HashMap map = new HashMap();
    	 map.put("doctorname", doctornames);
    	 return map;
    }
    
    @Override
    public Indexable fromIndex(Map map) {
        if (map == null) {
            return this;
        }
        this.doctornames=(String)map.get("doctorname");
    	return this;
    }
}
